<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    手机号: <input type="text"><button class="btn" onclick="send()">发送短信</button>
    <script>
        var btn = document.querySelector('.btn');
        function send() {
            btn.disabled = true;
            var rest = 60000;
            var timer = setInterval(() => {
                btn.innerText = '还剩' + (rest / 1000)+ 's';
                rest -= 1000;
                console.log(rest);
            }, 1000);
            setTimeout(() => {
                // btn.disabled = false;
                this.disabled = false;
                window.clearInterval(timer);
                // btn.innerText = '发送短信';
                this.innerText = '发送短信';
            }, 60000);
        }
    </script>
</body>
</html>